<template>
    <view class="title-bar">
        <view class="title-text">
            {{ props.title }}
        </view>
        <view 
            class="view-all"
            @click="viewAll"
        >
            查看全部 >
        </view>
    </view>
</template>

<script lang="ts" setup>
    import { onLoad, onShow, onHide, onReady } from '@dcloudio/uni-app'
    import { markRaw, reactive, ref } from 'vue'
    import type { Ref, Raw } from 'vue'
    const props = withDefaults(defineProps<{
        title?: string,
        path?: string,
    }>(), {
        title: '',
        path: ''
    }) 
    const viewAll = () => {
        uni.navigateTo({
            url: props.path
        })
    }
    // const emits = defineEmits<{
    //     (e:'update:loading', data: any): void
    //     (e:'viewAll', data: string): void
    // }>()
    // const viewAll = () => {
    //     emits('viewAll', '')
    // }
</script>

<style lang="scss" scoped>
    .title-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        .title-text {
            font-size: 32rpx;
            font-weight: bold;
        }
        .view-all {
            font-size: 28rpx;
            color: #797979;
        }
    }

</style>
